from os import makedirs
from numpy.core.function_base import linspace
import scipy.io as scio
import numpy as np 
import matplotlib.pyplot as plt
import matplotlib.image as img
from PIL import Image
import xlwt
import cv2
import numpy as np
import h5py

def rgb2gray(rgb):
    return np.dot(rgb[...,:3], [0.299, 0.587, 0.114])


mask = cv2.imread('2.png')
#mask = rgb2gray(mask)
b, g, r = cv2.split(mask)

np.savetxt("b.txt",b)
np.savetxt("r.txt",r)
np.savetxt("g.txt",g)
'''
r.tofile("r.bin")
g.tofile("g.bin")
b.tofile("b.bin")
'''
